﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace XGE.Physics
{
    public class PhysicsInfo : IEnumerable<PhysicsInfo>, IEnumerator<PhysicsInfo>
    {
        bool enabled;
        public Vector2 position;
        public bool Enabled
        {
            get { return enabled; }
            set { enabled = value; }
        }
        public float Height;
        public Rectangle collisionBox;
        float Radius;
        public float Resitance = 0.7f;
        public Vector2 Velocity = Vector2.Zero;

        public void UpdateCollisionBox()
        {
            collisionBox.X = (int)position.X;
            collisionBox.Y = (int)position.Y;
        }
        public void Initialize(Vector2 Position, int Height, int Width)
        {
            position = Position;
            UpdateCollisionBox();
            collisionBox.Height = Height;
            collisionBox.Width = Width;
        }

        //These will be used so that the methods like Except can be used.
        #region IEnumerable<PhysicsInfo> Members

        public IEnumerator<PhysicsInfo> GetEnumerator()
        {
            return this ;
        }

        #endregion

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this;
        }

        #endregion

        #region IEnumerator<PhysicsInfo> Members

        PhysicsInfo IEnumerator<PhysicsInfo>.Current
        {
            get { return this; }
        }

        #endregion

        #region IDisposable Members

        void IDisposable.Dispose()
        {
            
        }

        #endregion

        #region IEnumerator Members

        object System.Collections.IEnumerator.Current
        {
            get { return this; }
        }

        bool System.Collections.IEnumerator.MoveNext()
        {

            return false;
        }

        void System.Collections.IEnumerator.Reset()
        {
 
        }

        #endregion
    }

}
